From d804137cf60997984d4e1bb201a3f0d1b41f678d Mon Sep 17 00:00:00 2001 From: Ewan Mellor Date: Mon, 26 Feb 2007 15:41:35 +0000 Subject: [PATCH] Fix xm vcpu-set command for when wrong number of VCPU is given Signed-off-by: Masaki Kanno --- tools/python/xen/xend/XendDomainInfo.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/python/xen/xend/XendDomainInfo.py b/tools/python/xen/xend/XendDomainInfo.py index 69e1cda45d..259898bdfd 100644 --- a/tools/python/xen/xend/XendDomainInfo.py +++ b/tools/python/xen/xend/XendDomainInfo.py @@ -938,6 +938,9 @@ class XendDomainInfo: return self.info['vcpus_number'] def setVCpuCount(self, vcpus): + if vcpus <= 0: + raise XendError('Invalid VCPUs') + self.info['vcpu_avail'] = (1 << vcpus) - 1 if self.domid >= 0: self.storeVm('vcpu_avail', self.info['vcpu_avail']) -- 2.30.2